//
//  HomeAssetListCell.m
//  ShandsMod
//
//  Created by zh_s on 2023/3/18.
//  Copyright © 2023 zh_s. All rights reserved.
//

#import "HomeAssetListCell.h"

@implementation HomeAssetListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryNone;
        self.backgroundColor = [UIColor clearColor];
        [self createView];
    }
    return self;
}

- (void)createView {
    
    UIImageView *headerImg = [[UIImageView alloc] init];
    [self.contentView addSubview:headerImg];
    headerImg.image = IMAGE_NAME(@"icon_home_more");
    [headerImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(35/2);
        make.width.height.mas_equalTo(53/2);
        make.left.mas_equalTo(26);
    }];
    GWRadius(headerImg, 53/4);
    
    UILabel *titleLab = [[UILabel alloc] init];
    [self.contentView addSubview:titleLab];
    titleLab.textColor = MAIN_BACKCOLOR;
    titleLab.font = FONT_NAME(FONT_Regular, 17);
    titleLab.text = @"BNB";
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(headerImg.mas_right).mas_offset(15);
        make.centerY.mas_equalTo(headerImg.mas_centerY);
        make.height.mas_equalTo(20);
    }];
//    self.titleLab = titleLab;
    
    UIView *lineView = [[UIView alloc] init];
    [self.contentView addSubview:lineView];
    lineView.backgroundColor = LINEVIEWCELL_BACKCOLOR;
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(67);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -87, 0.5));
    }];
    
    UILabel *priceLab = [[UILabel alloc] init];
    [self.contentView addSubview:priceLab];
    priceLab.textColor = TEXT_COLOR_51;
    priceLab.font = FONT_NAME(FONT_Regular, 12);
    priceLab.text = @"7866.04";
    priceLab.textAlignment = NSTextAlignmentRight;
    [priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_offset(-25);
        make.top.mas_equalTo(headerImg.mas_top).mas_offset(1);
        make.height.mas_equalTo(12);
    }];
//    self.contentLab = cntentLab;
    
    UILabel *usdPriceLab = [[UILabel alloc] init];
    [self.contentView addSubview:usdPriceLab];
    usdPriceLab.textColor = TEXT_COLOR_153;
    usdPriceLab.font = FONT_NAME(FONT_Regular, 10);
    usdPriceLab.text = @"≈$12345.44";
    usdPriceLab.textAlignment = NSTextAlignmentRight;
    [usdPriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(priceLab.mas_right);
        make.top.mas_equalTo(headerImg.mas_top).mas_offset(15);
        make.height.mas_equalTo(10);
    }];
}

@end
